<script setup>
import { ref } from 'vue';

import 'ant-design-vue/dist/reset.css';

const designer = ref(null);
const config = ref({
  showSaveBtn: true,
});
const options = ref({
  onSubmit: (formData) => {
    alert(JSON.stringify(formData));
  },
  resetBtn: true,
});
const rule = ref([
  {
    type: 'input',
    field: 'goods_name',
    title: '商品名称',
    value: 'form-create',
  },
  {
    type: 'checkbox',
    field: 'label',
    title: '标签',
    value: [0, 1, 2, 3],
    options: [
      { label: '好用', value: 0 },
      { label: '快速', value: 1 },
      { label: '高效', value: 2 },
      { label: '全能', value: 3 },
    ],
  },
]);
const save = () => {
  console.log(designer.value.getJson());
  // getFormData();
  // console.log(formData);
};
</script>

<template>
  <!-- <form-create :rule="rule" v-model:api="api" :option="options" /> -->
  <fc-designer ref="designer" height="100vh" :config="config" @save="save" />
</template>
